<?php

namespace app\admin\validate;

use think\Validate;

class Business extends Validate
{
	/**
	 * 验证规则
	 */
	protected $rule = [
		'username' => 'require|max:50',
		'nickname' => 'require',
		'password' => 'require',
		'name' => 'require|max:50',
	];
	/**
	 * 提示消息
	 */
	protected $message = [
	];
	/**
	 * 验证场景
	 */
	protected $scene = [
		'add'  => ['username', 'nickname', 'password', 'name'],
		'edit' => ['username', 'nickname', 'name'],
	];
	
	public function __construct(array $rules = [], $message = [], $field = [])
	{
		$this->field = [
			'username' => __('Username'),
			'nickname' => __('Nickname'),
			'password' => __('Password'),
		];
		parent::__construct($rules, $message, $field);
	}
}
